This repository has no description
semble
/
src
/
webapp
/
app
/
(dashboard)
/
profile
/
[handle]
/
(withHeader)
/
collections
/
layout.tsx
887 B
35 lines
1import { ApiClient } from '@/api-client/ApiClient';
2import { createClientTokenManager } from '@/services/auth';
3import type { Metadata } from 'next';
4import { Fragment } from 'react';
5
6interface Props {
7 params: Promise<{ handle: string }>;
8 children: React.ReactNode;
9}
10
11export async function generateMetadata({ params }: Props): Promise<Metadata> {
12 const { handle } = await params;
13
14 const apiClient = new ApiClient(
15 process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000',
16 createClientTokenManager(),
17 );
18
19 const profile = await apiClient.getProfile({
20 identifier: handle,
21 });
22
23 return {
24 title: `${profile.name}'s collections`,
25 description: `Explore ${profile.name}'s collections on Semble`,
26 };
27}
28
29interface Props {
30 children: React.ReactNode;
31}
32
33export default function Layout(props: Props) {
34 return <Fragment>{props.children}</Fragment>;
35}